import React from 'react'
import { Redirect } from 'react-router-dom'
import CityInfo from '../pages/cityInfo/cityInfo';
import Dashboard from '../pages/dashboard/dashboard';
import ViewChart from '../pages/dashboard/viewCharts/viewCharat';
import DataMonitor from '../pages/dashboard/dataMonitor/dataMonitor';
import InfoManage from '../pages/dashboard/infoManage/infoManage';
import InfoDetail from '../pages/dashboard/infoDetail';
import ScenicSpot from '../pages/scenicSpot/scenicSpot';
import Project from '../pages/projectMgmt/project';
import Environment from '../pages/environment/environment';
import ProductManagement from '../pages/productManagement/productManagement';
import PeopleLive from '../pages/peopleLive/peopleLive';
import MapInfo from '../pages/maps/mapInfo/mapInfo';
import Point from '../pages/maps/point/point';
import User from '../pages/center/user/user';
import Config from '../pages/alarmMgmt/config/config';
import Person from '../pages/center/person/person';
import List from '../pages/alarmMgmt/list/list';
import CityPlan from '../pages/cityPlan/cityPlan';
import Home from '../pages/index';
import Login from '../pages/login/login';
import Screen from '../pages/screen/screen';
import ApprovalDetail from '../pages/dashboard/approvalDetail';
import Account from '../pages/account/account';

import {
    PieChartOutlined,
    BarChartOutlined,
    DashboardOutlined,
    BankOutlined, 
    ProfileOutlined,
    PartitionOutlined,
    ExperimentOutlined,
    OrderedListOutlined,
    YuqueOutlined,
    EnvironmentOutlined,
    StarOutlined,
    ToolOutlined,
    SmileOutlined,
    TeamOutlined,
    ScissorOutlined,
    GlobalOutlined,
    LikeOutlined,
    AlertOutlined,
    BugOutlined,
    MenuUnfoldOutlined,
    SafetyOutlined,
    CompassOutlined,
} from '@ant-design/icons';
const routes = [
    {
        path: "/login",
        key: 'login',
        component: Login
    },
    {
        path: "/screen",
        key: 'screen',
        component: Screen
    },                    
    {
        path:"/",
        component: Home,
        key:'index',
        routes:[
            {
                path:"/dashboard",
                key: 'dashboard',
                title:'后台概览',
                icon: <DashboardOutlined spin={false} style={{fontSize:18}} />,
                component: Dashboard,
                routes:[
                    {
                        path:"/dashboard/infoManage",
                        key: 'infoManage',
                        exact: true,
                        title:'信息概览',
                        icon: <ProfileOutlined style={{fontSize:18}} />,
                        component: InfoManage,
                    },
                    {
                        path:"/dashboard/dataMonitor",
                        key: 'dataMonitor',
                        exact: true,
                        title:'大数据云监控',
                        icon: <BarChartOutlined style={{fontSize:18}} />,
                        component: DataMonitor,
                    },                     
                    // {
                    //     path:"/dashboard/viewChart",
                    //     key: 'viewChart',
                    //     exact: true,
                    //     title:'图表一览',
                    //     icon: <PieChartOutlined style={{fontSize:18}} />,
                    //     component: ViewChart,
                    // },  
                                                                                
                ]                
            },      
            {
                path:"/cityInfo",
                key: 'cityInfo',
                title:'城区数据管理',
                icon: <SafetyOutlined style={{fontSize:18}}/>,
                component: Dashboard,
                routes:[
                    {
                        path:"/cityInfo/cityData",
                        key: 'cityData',
                        exact: true,
                        title:'城区数据',
                        icon: <PartitionOutlined style={{fontSize:18}} />,
                        component: CityInfo,
                    },
                    {
                        path:"/cityInfo/scenicSpot",
                        key: 'scenicSpot',
                        title:'旅游管理',
                        icon: <BankOutlined style={{fontSize:18}} /> ,
                        component: ScenicSpot,                             
                    },     
                    {
                        path:"/cityInfo/project",
                        key: 'project',
                        title:'工程管理',
                        icon: <OrderedListOutlined style={{fontSize:18}}/>,
                        component: Project,                             
                    },   
                    {
                        path:"/cityInfo/develop",  
                        key: 'develop',
                        title:'生产管理',
                        icon: <ExperimentOutlined style={{fontSize:18}}/>,
                        component: ProductManagement,                             
                    },                                                                                             
                ]                            
            },
            {
                path:"/alarmMgmt",
                key: 'alarmMgmt',
                title:'告警中心',
                icon: <AlertOutlined style={{fontSize:18}}/>,
                component: Dashboard,
                routes:[
                    {
                        path:"/alarmMgmt/list",
                        key: 'list',
                        exact: true,
                        title:'云服务告警',
                        icon: <MenuUnfoldOutlined style={{fontSize:18}} />,
                        component: List,
                    },
                    {
                        path:"/alarmMgmt/config",
                        key: 'config',
                        title:'告警处置',
                        icon: <BugOutlined style={{fontSize:18}} />, 
                        component: Config,
                    },                                                               
                ]                            
            },                                           
            {
                path:"/infoDetail",
                key: 'infoDetail',
                title:'数据详情',
                hiddenInMenu: true,
                icon: <PartitionOutlined style={{fontSize:18}}/>,
                component: InfoDetail,                             
            },
            {
                path:"/account",
                key: 'account',
                title:'数据详情',
                hiddenInMenu: true,
                icon: <PartitionOutlined style={{fontSize:18}}/>,
                component: Account,                             
            },
            {
                path:"/approvalDetail",
                key: 'approvalDetail',
                title:'审批详情',
                hiddenInMenu: true,
                icon: <PartitionOutlined style={{fontSize:18}}/>,
                component: ApprovalDetail,                             
            },  
            {
                path:"/cityPlan",
                key: 'cityPlan',
                title:'规划建设',
                icon: <CompassOutlined style={{fontSize:18}} />,
                component: Dashboard,
                routes:[
                    {
                        path:"/cityPlan/itemPlan",
                        key: 'itemPlan',
                        title:'项目规划',
                        icon: <ScissorOutlined style={{fontSize:18}} />,
                        component: CityPlan,                             
                    },  
                ]
            },               
            {
                path:"/peopleLive",
                key: 'people',
                title:'民生问题',
                icon: <LikeOutlined  style={{fontSize:18}} />,
                component: PeopleLive,                             
            },
            {
                path:"/environment",
                key: 'environment',
                title:'环境管理',
                icon: <YuqueOutlined style={{fontSize:18}}/>,
                component: Environment,                             
            },              
            {
                path:"/maps",
                key: 'maps',
                title:'地图管理',
                icon: <GlobalOutlined style={{fontSize:18}} />,
                component: Dashboard,
                routes:[
                    {
                        path:"/maps/mapInformation",
                        key: 'mapInformation',
                        exact: true,
                        title:'地图数据',
                        icon: <EnvironmentOutlined style={{fontSize:18}} />,
                        component: MapInfo,
                    },
                    {
                        path:"/maps/point",
                        key: 'point',
                        title:'资源标记管理',
                        icon: <StarOutlined style={{fontSize:18}} />,
                        component: Point,
                    },                                                               
                ]                
            },
            {
                path:"/center",
                key: 'center',
                title:'管理中心',
                icon: <ToolOutlined style={{fontSize:18}}/>,
                component: Dashboard,
                routes:[
                    {
                        path:"/center/person",
                        key: 'person',
                        exact: true,
                        title:'个人中心',
                        icon: <SmileOutlined style={{fontSize:18}} />,
                        component: Person,
                    },
                    {
                        path:"/center/user",
                        key: 'user',
                        title:'用户管理',
                        icon: <TeamOutlined style={{fontSize:18}} />, 
                        component: User,
                    },                                                               
                ]                            
            },                                                                                       
        ]
    },
    {
        path: "/",
        key: 'Login',
        render: () => {
            return <Redirect to={"/dashboard/infoManage"} />
        }
    },   
    { path: '*', redirect: '/404', hidden: true }    
]

export default routes